#include<stdio.h>
#include<string.h>
long long int test(long long int m,long long int n)
{
    long long int min=m<n?m:n;
    long long int i=min;
    for(i=min;i>=1;i--)
    {
        if(m%i==0&&n%i==0)
        {
            return i;
            break;
        }
    }
}
int main()
{
    long long int n;
    char x;
    
    //while()
    //{
        scanf("%lld",&n);
        char a[10000];
        memset(a,0,10000);
        long long int i,j,s1=0,s2=0;
        fgets(a,10000,stdin);
        for(i=0;i<(4*n-1);)
        {
            s1=s1+(a[i]-48);
            i=i+4;
        }
        for(i=2;i<(4*n-1);)
        {
            s2=s2+(a[i]-48);
            i=i+4;
        }
        if(s1/s2!=0)
        {
            printf("%d %d/%d\n",s1/s2,s1/(test(s1,s2)),s2/(test(s1,s2)));

        }
        //memset(a,0,10000);




    //}
    return 0;
}